home *** CD-ROM | disk | FTP | other *** search
- /* scn3.c - utilities for setting up screen I/O */
-
- #include "stdio.h"
- #include "cminor.h"
- #include "video.h"
- #include "asmtools.h"
- #include "scn.h"
-
- #define EQUIP_DET 0x11 /* software int no. for equiptment */
- /* determination */
- #define DISP_BITS 0x30 /* mask for display type bits */
- #define BW_DISP 0x30 /* value of above bits for mono disp. */
- #define CG_USED 1 /* screen type = color/graphics */
- #define MONO_USED 0 /* screen type = monochrome adaptor */
-
- int scn_type() /* get type of display adapter used */
- {
- REGS sreg , dreg ;
-
- swint(EQUIP_DET,&sreg,&dreg) ;
- dreg.ax = dreg.ax & DISP_BITS; /* isolate display type */
- if( dreg.ax != BW_DISP ) /* is it mono adapter type ? */
- return( CG_USED ) ; /* no - return Color Gr. in use */
- else return( MONO_USED ) ; /* yes - return MONO in use */
- }
-
-
- int scn_addr(pscn) /* set display address */
- SCN_DATA *pscn ; /* address of screen control block */
- {
- if( scn_type() == MONO_USED )
- { pscn->scn_seg = MONO_SEG ;
- pscn->stport = MONO_BASE + CRT_STATUS ;
- }
- else
- { pscn->scn_seg = CG_SEG ;
- pscn->stport = COLOR_BASE + CRT_STATUS ;
- }
- }
-
-
-